package org.bigjava.mapper;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.bigjava.bean.Admin;
import org.springframework.stereotype.Repository;

import java.util.List;

@Mapper
@Repository("adminMapper")
public interface AdminMapper {

    @Select("select * from admin")
    public List<Admin> cha();

    //根据账号密码查询(管理员登录)
    @Select("select * from admin where username=#{username} and password=#{password}")
    public Admin adminDengLu(String username,String password);

    //管理员修改个人信息
    @Update("update admin set username=#{username},password=#{password},nickname=#{nickname} where id=#{id}")
    public int adminXiuGai(Admin admin);

}
